/**
 * 工程名称:oms
 * 文件名称:StockFmlaRatioSkuDAOImpl.java
 * 所属包:cn.rkylin.oms.system.stockpush.dao.impl
 * 创建时间:2017年9月4日上午11:40:55
 * Copyright (c) 2017 瑞金麟(大连)信息技术有限公司 All Rights Reserved.
 * 创建人:zhanghao
 */

package cn.rkylin.oms.system.stockpush.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.system.stockpush.dao.IStockFmlaRatioSkuDAO;
import cn.rkylin.oms.system.stockpush.domain.StockFmlaRatioSku;
import cn.rkylin.oms.system.stockpush.vo.StockFmlaRatioSkuVO;

/**
 * 类名:StockFmlaRatioSkuDAOImpl <br/>
 * 作用: 商品店铺推送比例设置的数据库交互类实现. <br/>
 * 创建原因:	 实现商品店铺推送比例设置的mysql数据库交互. <br/>
 * 创建时间:     2017年9月4日 上午11:40:55 <br/>
 * @author   zhanghao
 * @version  v1.0
 * @since    JDK 1.6
 * @see 	 
 */
@Repository(value = "stockFmlaRatioSkuDAO")
public class StockFmlaRatioSkuDAOImpl implements IStockFmlaRatioSkuDAO {
    private static final String STMT_SELECT_DISTINCT_SKU = "selectDistinctSku";
    private static final String STMT_SELECT_SKU_RATIO = "selectByPrimaryKeyRatioSku";
    private static final String STMT_INSERT = "insertSelectiveRatioSku";
    private static final String STMT_UPDATE_SELECTIVE = "updateByPrimaryKeySelectiveRatioSku";
    @Autowired
    protected IDataBaseFactory dao;
    
    public StockFmlaRatioSkuDAOImpl() {
        
    }
    @Override
    public int deleteByPrimaryKey(String ratioId) {

        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int insert(StockFmlaRatioSku record) throws Exception {
        return dao.insert(STMT_INSERT, record);
    }

    @Override
    public int insertSelective(StockFmlaRatioSku record) {

        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public StockFmlaRatioSku selectByPrimaryKey(String ratioId) {

        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(StockFmlaRatioSku record) throws Exception {
        return dao.update(STMT_UPDATE_SELECTIVE, record);
    }

    @Override
    public int updateByPrimaryKey(StockFmlaRatioSku record) {

        // TODO Auto-generated method stub
        return 0;
    }

    /**
     * 方法复写
     * 查询所有设置过仓库推送比例的商品的列表.
     * @see cn.rkylin.oms.system.stockpush.dao.IStockFmlaRatioSkuDAO#getDistinckSetSku(int, int, cn.rkylin.oms.system.stockpush.vo.StockFmlaRatioSkuVO)
     */
    @Override
    public List<StockFmlaRatioSkuVO> getDistinckSetSku(int page, int length, StockFmlaRatioSkuVO stockFmlaRatioSkuVO) throws Exception {
        List<StockFmlaRatioSkuVO> result = dao.findAllList(STMT_SELECT_DISTINCT_SKU, stockFmlaRatioSkuVO);
        return result;
    }
    @Override
    public List<StockFmlaRatioSkuVO> selectBySelectiveValue(StockFmlaRatioSkuVO stockFmlaRatioSkuVO) throws Exception {
        List<StockFmlaRatioSkuVO> result = dao.findAllList(STMT_SELECT_SKU_RATIO, stockFmlaRatioSkuVO);
        return result;
    }

}

